package com.steven.concurrency.example.singleton;

import com.steven.concurrency.annoations.NotRecommend;

/**
 * 懒汉式
 */
@NotRecommend
public class LazySingleton {
    private LazySingleton(){

    }

    private static LazySingleton singleton = null;

    public static synchronized LazySingleton  getInstance(){
        if(singleton==null){
            singleton = new LazySingleton();
        }
        return singleton;
    }
}
